#from random import randrange
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Stock Tweets</title> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 
<link href="/static/css/jquery-ui-1.8.9.mine.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/static/js/jquery-1.4.4.min.js"></script> 
<script type="text/javascript" src="/static/js/jquery-ui-1.8.9.custom.min.js"></script> 
#raw
<script>
function follow(name1,name2){
	$.post("follow",{'name1':name1,'name2':name2});
}
function unfollow(name1,name2){
	$.post("unfollow",{'name1':name1,'name2':name2});
}
</script>
#end raw
<style type="text/css">
a{ text-decoration: none;}
</style>
</head>

<body>
#for user in $users 
<p><span>$user.name (粉丝： $user.fans_count, 关注： $user.follows_count)</span> 

#if $user.name in $logged_user.follows
<a style="margin-left: 8px;" href="#" 
onclick="unfollow('$logged_user.name','$user.name')">-取消关注</a> 
</p>
#elif $user.name != $logged_user.name
<a style="margin-left: 8px;" href="#" 
onclick="follow('$logged_user.name','$user.name')">+关注</a> 
#end if
#end for
</body>
</html>
